#include "plugin_api.h"
#include "so_wrapper.h"
#include <dlfcn.h>
#include <iostream>

int main()
{
    SharedObject so("/data/TUTORIAL/concurrency_parallelism/bazel-bin/load_shared_lib/example2_plugin.so");
    using create_t = PluginBase* (*)();
    using destroy_t = void (*)(PluginBase*);
    create_t create = so.getSymbol<create_t>("create");
    destroy_t destroy = so.getSymbol<destroy_t>("destroy");

    PluginBase* p = create();
    std::cout << p->name() << std::endl;
    p->run();
    destroy(p);

    return 0;
}
